from .web_element import WebElement


class TextAreaTag(WebElement):
    '''
    input元素操作
    '''

    def get_name(self):
        '''
        获取网页元素的name属性值

        :Returns:
            返回网页元素的name属性值
        '''
        return self.control.GetName

    def set_name(self, name):
        '''
        设置网页元素的name属性值

        :Args:
         - name: 网页元素的name属性值
        '''
        self.control.SetName(name)

    def get_placeholder(self):
        '''
        获取网页元素的placeholder属性值

        :Returns:
            返回网页元素的placeholder属性值
        '''
        return self.control.GetPlaceholder

    def set_placeholder(self, placeholder):
        '''
        设置网页元素的placeholder属性值

        :Args:
         - placeholder: 网页元素的placeholder属性值
        '''
        self.control.SetPlaceholder(placeholder)

    def get_title(self):
        '''
        获取网页元素的title属性值

        :Returns:
            返回网页元素的title属性值
        '''
        return self.control.GetTitle

    def set_title(self, title):
        '''
        设置网页元素的title属性值

        :Args:
         - title: 网页元素的title属性值
        '''
        self.control.SetTitle(title)

    def get_auto_focus(self):
        '''
        获取网页元素的autofocus属性值

        :Returns:
            返回网页元素的autofocus属性值
        '''
        return self.control.GetAutoFocus

    def set_auto_focus(self, auto_focus):
        '''
        设置网页元素的autofocus属性值

        :Args:
         - auto_focus: 网页元素的autofocus属性值
        '''
        self.control.SetAutoFocus(auto_focus)

    def get_tabindex(self):
        '''
        获取网页元素的tabindex属性值

        :Returns:
            返回网页元素的tabindex属性值
        '''
        return self.control.GetTabindex

    def set_tabindex(self, tabindex):
        '''
        设置网页元素的tabindex属性值

        :Args:
         - tabindex: 网页元素的tabindex属性值
        '''
        self.control.SetTabindex(tabindex)

    def get_rows(self):
        '''
        获取网页元素的rows属性值

        :Returns:
            返回网页元素的rows属性值
        '''
        return self.control.GetRows

    def set_rows(self, rows):
        '''
        设置网页元素的rows属性值

        :Args:
         - rows: 网页元素的rows属性值
        '''
        self.control.SetRows(rows)

    def get_cols(self):
        '''
        获取网页元素的cols属性值

        :Returns:
            返回网页元素的cols属性值
        '''
        return self.control.GetCols

    def set_cols(self, cols):
        '''
        设置网页元素的cols属性值

        :Args:
         - cols: 网页元素的cols属性值
        '''
        self.control.SetCols(cols)

    def get_required(self):
        '''
        获取网页元素的required属性值

        :Returns:
            返回网页元素的required属性值
        '''
        return self.control.GetRequired

    def set_required(self, required):
        '''
        设置网页元素的required属性值

        :Args:
         - required: 网页元素的required属性值
        '''
        self.control.SetRequired(required)

    def get_max_length(self):
        '''
        获取网页元素的maxlength属性值

        :Returns:
            返回网页元素的maxlength属性值
        '''
        return self.control.GetMaxLength

    def set_max_length(self, max_length):
        '''
        设置网页元素的maxlength属性值

        :Args:
         - max_length: 网页元素的maxlength属性值
        '''
        self.control.SetMaxLength(max_length)

    def get_wrap(self):
        '''
        获取网页元素的wrap属性值

        :Returns:
            返回网页元素的wrap属性值
        '''
        return self.control.GetWrap

    def set_wrap(self, wrap):
        '''
        设置网页元素的wrap属性值

        :Args:
         - wrap: 网页元素的wrap属性值
        '''
        self.control.SetWrap(wrap)

    def get_attribute(self, name):
        '''
        获取属性值

        :Args:
         - name: 属性名称

        :Returns:
            返回属性值
        '''
        if name == 'class':
            return self.get_css_class()
        elif name == 'id':
            return self.get_id()
        elif name == 'tabindex':
            return self.get_tabindex()
        elif name == 'name':
            return self.get_name()
        elif name == 'required':
            return self.get_required()
        elif name == 'placeholder':
            return self.get_placeholder()
        elif name == 'title':
            return self.get_title()
        elif name == 'rows':
            return self.get_rows()
        elif name == 'cols':
            return self.get_cols()
        elif name == 'maxlength':
            return self.get_max_length()
        elif name == 'autofocus':
            return self.get_auto_focus()
        elif name == 'wrap':
            return self.get_wrap()
        else:
            return self.get_attribute_value(name)